package com.example.demo.response.supplier;

import com.example.demo.entity.ProductSupplier;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class ListFormat {
    public  Map<Integer, Object> ListFormat(List<ProductSupplier> suppliers) {
        Map<String,Object> item = new HashMap<>();
        Map<Integer,Object> list = new HashMap<>();
        Integer i = 0;
        for (ProductSupplier supplier : suppliers){
            item.put("id",supplier.id);
            list.put(i,item);
            i++;
        }
        return list;
    }

}
